<%--
 - Copyright (c) 2009-2011 ETCORE Labs. All rights reserved. 
 - 
 - This software is the confidential and proprietary information of ETCORE Labs. 
 - You shall not disclose such confidential information and shall use it only
 - in accordance with the terms of the license agreement you entered into
 - with ETCORE Labs.
 -
 - Support can be obtained from support forums at:
 - http://www.etcore.com/
 -
 - @author: ETCORE GroupTalk developers
 -
 --%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="/group/css/styles.css" type="text/css">
<script language="javascript">
function checkModifyPwdForm()
{
	if(ModifyPwdForm.userPwd.value == "")
	{
		alert("<c:out value='${context.msg_pwd_null }' />");
		ModifyPwdForm.userPwd.focus();
		return false;
	}
	
	if(ModifyPwdForm.userNewPwd.value == "")
	{
		alert("<c:out value='${context.msg_new_pwd_null }' />");
		ModifyPwdForm.userNewPwd.focus();
		return false;
	}
	if(ModifyPwdForm.userNewPwd.value.length < 6)
	{
		alert("<c:out value='${context.msg_new_pwd_length }' />");
		ModifyPwdForm.userNewPwd.focus();
		return false;
	}	

	if(ModifyPwdForm.userNewPwd.value != ModifyPwdForm.userNewPwd1.value)
	{
		alert("<c:out value='${context.msg_new_pwd_same }' />");
		ModifyPwdForm.userNewPwd.focus();
		return false;
	}
	return true;
}


</script>
<script>

 
function  showPwdControl(){
	var pwdControl=document.getElementById("pwdControl"); 
	var signControl=document.getElementById("signControl");
	var mailControl=document.getElementById("mailControl"); 
	var winback=document.getElementById("winback"); 
	pwdControl.style.display =  "" ;  
	var leftOffset=(document.body.clientWidth-400)/2;
	pwdControl.style.left=leftOffset; 
	var topOffset=(document.body.clientHeight-200)/2;
	pwdControl.style.top=topOffset+document.body.scrollTop; 
	winback.style.display =  "" ; 
	 mailControl.style.display =  "none" ;   
	signControl.style.display =  "none" ;  
 
	
}

function  showMailControl(){
	var pwdControl=document.getElementById("pwdControl"); 
	var signControl=document.getElementById("signControl");
	var mailControl=document.getElementById("mailControl"); 
	var winback=document.getElementById("winback"); 
	pwdControl.style.display =  "none" ;  
	mailControl.style.display =  "" ;  
	signControl.style.display =  "none" ; 
	var leftOffset=(document.body.clientWidth-400)/2;
	mailControl.style.left=leftOffset; 
	var topOffset=(document.body.clientHeight-200)/2;
	mailControl.style.top=topOffset+document.body.scrollTop; 
	winback.style.display =  "" ; 
 
	
}

function  showSignControl(){
	var pwdControl=document.getElementById("pwdControl"); 
	var signControl=document.getElementById("signControl");
	var mailControl=document.getElementById("mailControl"); 
	var winback=document.getElementById("winback"); 
	pwdControl.style.display =  "none" ;  
	mailControl.style.display =  "none" ;  
	signControl.style.display =  "" ; 
	var leftOffset=(document.body.clientWidth-400)/2;
	signControl.style.left=leftOffset; 
	var topOffset=(document.body.clientHeight-200)/2;
	signControl.style.top=topOffset+document.body.scrollTop; 
	winback.style.display =  "" ; 
 
	
}
function  hideAll()  {

	var pwdControl=document.getElementById("pwdControl"); 
	var mailControl=document.getElementById("mailControl"); 
	var signControl=document.getElementById("signControl"); 
	var winback=document.getElementById("winback"); 
    pwdControl.style.display =  "none" ;  
    mailControl.style.display =  "none" ;  
    signControl.style.display =  "none" ;  
	winback.style.display =  "none" ; 
	
}
function  showStyle(id)  {

	var myMenu=document.getElementById("myMenu"); 
	var elements=myMenu.getElementsByTagName("tr");
	for(var i=0;i<elements.length;i++){
		elements[i].bgColor="#ffffff";
		var elementDiv=elements[i].getElementsByTagName("div")[0];
		elementDiv.style.color="#005EAC";
	}
	var targetElement=document.getElementById(id); 
	targetElement.bgColor="#005EAC";
	var targetDiv=targetElement.getElementsByTagName("div")[0];
	targetDiv.style.color="white";
	 
	 
}
</script>
</head>
<body>


<table>
	<tr>
		<td valign=top>
		<div
			style="position: relative; padding: 0px; background-color: white; overflow: auto;">

		<table cellspacing=3 cellpadding=0>

			<tr>
				<td style="border: 0px solid #b4d2d4; width: 210px;" align=center><c:if
					test="${not empty session_user.avatar&&fn:indexOf(session_user.avatar,'upload')!=-1 }">
					<img src="${session_user.avatar}" height=160 border=0 />
				</c:if><c:if
					test="${empty session_user.avatar||fn:indexOf(session_user.avatar,'upload')==-1 }">
					<img src="/group/images/avatar/avatar.jpg" width=190 border=0 />
				</c:if></td>

			</tr>

			<tr>
				<td align=center>


				<table style="border: 2px solid #f2f2f2" width=100%>


					<tr>
						<td colspan=2
							style="height: 15px; font-size: 12px; color: #808080" nowrap><c:out
							value="${context.reg_time }" /></td>
						<td style="height: 15px; font-size: 12px; color: #005EAC" nowrap><c:out
							value="${session_user.regTime }" /></td>
					</tr>
					<tr>
						<td colspan=2
							style="height: 15px; font-size: 12px; color: #808080" nowrap><c:out
							value="${context.last_access }" /></td>
						<td style="height: 15px; font-size: 12px; color: #005EAC" nowrap><c:out
							value="${session_user.lastTime }" /></td>
					</tr>
					<tr>
						<td colspan=2
							style="height: 15px; font-size: 12px; color: #808080" nowrap><c:out
							value="${context.log_num }" /></td>
						<td style="height: 15px; font-size: 12px; color: #005EAC"><c:out
							value="${session_user.loginNum }" /></td>
					</tr>
					<tr>
						<td style="height: 15px; font-size: 12px; color: #808080" nowrap>Email</td>
						<td align=right><c:if test="${isAdmin }">
							<img style="cursor: pointer" src="/group/images/edit.jpg"
								onclick="showMailControl()" />
						</c:if></td>
						<td style="height: 15px; font-size: 12px; color: #005EAC">&nbsp;<c:out
							value="${session_user.email }" /></td>


					</tr>
					<c:if test="${session_user.isLock==1}">
						<tr>
							<td colspan=3 nowrap
								style="height: 15px; font-size: 12px; color: #ffffff"><input
								type=button
								value="<c:out
								value='${context.send_activation_code}' />"
								style="cursor: pointer; border: 0px; height: 20px; width: 90px; background: #36518B; font-size: 12px; color: #ffffff"
								title="${context.send_activation_code} to <c:out value='${session_user.email }' />"
								onclick="location='/group/reSendActivationMail<c:out value='${context.postfix}' />?cmd=reSendActivationMail';">
							</td>
						</tr>
					</c:if>
					<tr>
						<td colspan=3 nowrap
							style="height: 15px; font-size: 12px; color: #ffffff"><input
							type=button value="${context.edit_avatar }"
							style="cursor: pointer; border: 0px; height: 20px; width: 70px; background: #36518B; font-size: 12px; color: #ffffff"
							onclick="switchConnection('uploadAvatar.action') "> <input
							type=button value="<c:out
							value='${context.editPwd}' />"
							style="cursor: pointer; border: 0px; height: 20px; width: 60px; font-size: 12px; color: #ffffff; background: #36518B;"
							onclick="showPwdControl()"><input type=button
							value="<c:out
							value="${context.logout}" />"
							style="cursor: pointer; border: 0px; height: 20px; font-size: 12px; color: #ffffff; background: #36518B;"
							onclick="location='/group/logout<c:out value="${context.postfix}" />?cmd=userLogout';"></td>
					</tr>

				</table>
				<table width=100%>
					<tr>
						<td colspan=2 nowrap><textarea readonly
							style="border: 2px solid #C5B1D8; font-size: 12px; color: #808080; overflow-y: visible"
							cols="23" rows="4 "><c:out
							value='${session_user.sign }' default='${context.default_sign }' /></textarea></td>
						<td align=right><img style="cursor: pointer"
							src="/group/images/edit.jpg" onclick="showSignControl()" /></td>

					</tr>

				</table>



				<table id="myMenu" width=100% cellspacing=0>
					<tr bgcolor="#ffffff" id="myMessages"
						onclick="showStyle('myMessages');">

						<td style="border-bottom: 1px solid #d2d4d2"><img
							src="/group/images/work.gif"></td>
						<td style="border-bottom: 1px solid #d2d4d2" nowrap>
						<div style="font-size: 12px; cursor: pointer; color: #005EAC"
							onclick="switchConnection('myMessages.action');return false;"><c:out
							value='${context.my_messages}' /> <font color=#808080>(${myMessagesCount})</font></div>
						</td>
					</tr>
					<tr bgcolor="#ffffff" id="myComments"
						onclick="showStyle('myComments');">

						<td style="border-bottom: 1px solid #d2d4d2"><img
							src="/group/images/talk.gif"></td>
						<td style="border-bottom: 1px solid #d2d4d2" nowrap>
						<div style="font-size: 12px; cursor: pointer; color: #005EAC"
							onclick="switchConnection('myComments.action');return false;"><c:out
							value='${context.my_comments}' /> <font color=#808080>(${myCommentsCount})</font></div>
						</td>
					</tr>
					<tr bgcolor="#ffffff" id="myFollowing"
						onclick="showStyle('myFollowing');">
						<td width=10 style="border-bottom: 1px solid #d2d4d2"><img
							src="/group/images/following.gif"></td>
						<td style="border-bottom: 1px solid #d2d4d2">
						<div style="font-size: 12px; cursor: pointer; color: #005EAC"
							onclick="switchConnection('myFollowing.action')">${context.my_following
						} <font color=#808080>(${myFollowingCount})</font></div>
						</td>
					</tr>
					<tr bgcolor="#ffffff" id="myFollowers"
						onclick="showStyle('myFollowers');">
						<td style="border-bottom: 1px solid #d2d4d2"><img
							src="/group/images/user.gif"></td>
						<td style="border-bottom: 1px solid #d2d4d2" nowrap>
						<div style="font-size: 12px; cursor: pointer; color: #005EAC"
							onclick="switchConnection('myFollowers.action')">${context.my_followers
						} <font color=#808080>(${myFollowersCount})</font></div>
						</td>
					</tr>
					<c:if test="${context.p2}">
						<tr bgcolor="#ffffff" id="myGroups"
							onclick="showStyle('myGroups');">
							<td style="border-bottom: 1px solid #d2d4d2"><img
								src="/group/images/community.gif"></td>
							<td style="border-bottom: 1px solid #d2d4d2" nowrap>
							<div style="font-size: 12px; cursor: pointer; color: #005EAC"
								onclick="switchConnection('myGroups.action');return false;">${context.my_groups
							} <font color=#808080>(${myGroupsCount})</font></div>
							</td>
						</tr>
					</c:if>
					<tr bgcolor="#ffffff" id="myFavourite"
						onclick="showStyle('myFavourite');">
						<td style="border-bottom: 1px solid #d2d4d2"><img
							src="/group/images/bookmark.gif"></td>
						<td style="border-bottom: 1px solid #d2d4d2" nowrap>
						<div style="font-size: 12px; cursor: pointer; color: #005EAC"
							onclick="switchConnection('myFavourite.action');return false;"><c:out
							value='${context.my_favourite}' /> <font color=#808080>(${myFavouriteCount})</font></div>
						</td>
					</tr>

				</table>



				</td>
			</tr>



			<tr>
				<td align=right><img onclick="showUserMenu()"
					style="cursor: pointer" src="/group/images/updown.bmp" border=0 /></td>
			</tr>
		</table>

		</div>
		</td>
	</tr>
</table>


<div id="pwdControl"
	style="display: none; valign: center; position: absolute; top: 25%; left: 20%; width: 400px; padding: 0px; border: 1px solid orange; background-color: white; z-index: 1002; overflow: hidden;">


<form name="ModifyPwdForm" onSubmit="return checkModifyPwdForm();"
	method=post action="/group/myInfo<c:out value='${context.postfix }' />">
<table cellpadding=0 cellspacing=0 border=0 width=100% align=center>
	<tr bgcolor="orange">
		<td nowrap><img src="/group/images/winlogo.gif" border=0>&nbsp;<b><c:out
			value='${context.editPwd }' /></b></td>
		<td align=right><img src="/group/images/close.gif" class=close
			onClick="hideAll()" border=0 /></td>
	</tr>


	<input type=hidden name=cmd value="editUserPwd">
	<input type=hidden name=userName
		value="<c:out value='${sessionScope.session_user.userName}' />">
	<tr bgcolor="#ffffff">
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;<c:out
			value='${context.text_user_name }' /></TD>
		<TD align=left>&nbsp;&nbsp;<c:out
			value=' ${sessionScope.session_user.userName}' /></TD>
	</TR>
	<tr bgcolor="#ffffff">
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;<c:out
			value='${context.text_pwd }' /></TD>
		<TD>&nbsp;&nbsp;<input type=password name="userPwd"
			maxlength="50" size="20" style="width: 200px"></TD>
	</TR>
	<tr>
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;<c:out
			value='${context.text_new_pwd }' /></TD>
		<TD>&nbsp;&nbsp;<input type=password name="userNewPwd"
			maxlength="50" size="20" style="width: 200px"></TD>
	</TR>
	<tr>
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;<c:out
			value='${context.text_new_pwd2 }' /></TD>
		<TD>&nbsp;&nbsp;<input type=password name="userNewPwd1"
			maxlength="50" size="20" style="width: 200px"></TD>
	</TR>
	<tr>
		<td align="center" colspan=2 style="height: 30px"><input
			type="submit" value="<c:out value='${context.button_ok }' />">&nbsp;&nbsp;<input
			type=button onclick="hideAll()"
			value="<c:out value='${context.button_cancel}' />"></td>
	</tr>
</table>
</form>

</div>




<div id="mailControl"
	style="display: none; valign: center; position: absolute; top: 25%; left: 20%; width: 400px; padding: 0px; border: 1px solid orange; background-color: white; z-index: 1002; overflow: hidden;">


<form method=post
	action="/group/myInfo<c:out value='${context.postfix }' />">
<table cellpadding=0 cellspacing=0 border=0 width=100% align=center>
	<tr bgcolor="orange">
		<td nowrap><img src="/group/images/winlogo.gif" border=0>&nbsp;<b><c:out
			value='${context.edit }' /></b></td>
		<td align=right><img src="/group/images/close.gif" class=close
			onClick="hideAll()" border=0 /></td>
	</tr>


	<input type=hidden name=cmd value="editMail">
	<input type=hidden name=userName
		value="<c:out value='${sessionScope.session_user.userName}' />">
	<tr bgcolor="#ffffff">
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;<c:out
			value='${context.text_user_name }' /></TD>
		<TD align=left>&nbsp;&nbsp;<c:out
			value=' ${sessionScope.session_user.userName}' /></TD>
	</TR>


	<tr bgcolor="#ffffff">
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;Email</TD>
		<TD>&nbsp;&nbsp;<input type=text name="userEmail" maxlength="50"
			size="30" style="width: 200px" value='${session_user.email } '></TD>
	</TR>

	<tr>
		<td align="center" colspan=2 style="height: 30px"><input
			type="submit" value="<c:out value='${context.button_ok }' />">&nbsp;&nbsp;<input
			type=button onclick="hideAll()"
			value="<c:out value='${context.button_cancel}' />"></td>
	</tr>
</table>
</form>

</div>



<div id="signControl"
	style="display: none; valign: center; position: absolute; top: 25%; left: 20%; width: 400px; padding: 0px; border: 1px solid orange; background-color: white; z-index: 1002; overflow: hidden;">


<form method=post
	action="/group/myInfo<c:out value='${context.postfix }' />">
<table cellpadding=0 cellspacing=0 border=0 width=100% align=center>
	<tr bgcolor="orange">
		<td nowrap><img src="/group/images/winlogo.gif" border=0>&nbsp;<b><c:out
			value='${context.edit }' /></b></td>
		<td align=right><img src="/group/images/close.gif" class=close
			onClick="hideAll()" border=0 /></td>
	</tr>


	<input type=hidden name=cmd value="editSign">
	<input type=hidden name=userName
		value="<c:out value='${sessionScope.session_user.userName}' />">
	<tr bgcolor="#ffffff">
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;<c:out
			value='${context.text_user_name }' /></TD>
		<TD align=left>&nbsp;&nbsp;<c:out
			value=' ${sessionScope.session_user.userName}' /></TD>
	</TR>
	<tr bgcolor="#ffffff">
		<td nowrap style="height: 30px" nowrap>&nbsp;&nbsp;<c:out
			value="${context.sign }" /></TD>
		<TD><textarea name=sign cols="40" rows="5 ">${session_user.sign }</textarea></TD>
	</TR>

	<tr>
		<td align="center" colspan=2 style="height: 30px"><input
			type="submit" value="<c:out value='${context.button_ok }' />">&nbsp;&nbsp;<input
			type=button onclick="hideAll()"
			value="<c:out value='${context.button_cancel}' />"></td>
	</tr>
</table>
</form>

</div>




</BODY>
</HTML>
